package what.basic.tree;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.tree.*;
import what.basic.basiccomponent.*;

public class Jdefaultmutabletreenode {
	Jdefaultmutabletreenode(){
		JFrame f=new Jframe().jframe("defaultmutabletreenode", 300, 00, true);
		Container cp=f.getContentPane();
		DefaultMutableTreeNode root=new DefaultMutableTreeNode("today to buy");
		DefaultMutableTreeNode node1=new DefaultMutableTreeNode("vegetable");
		DefaultMutableTreeNode node2=new DefaultMutableTreeNode("fruit");
		DefaultMutableTreeNode node3=new DefaultMutableTreeNode("present");
		DefaultMutableTreeNode node4=new DefaultMutableTreeNode("small househode items");
		root.add(node1);
		root.add(node2);
		root.add(node3);
		root.add(node4);
		DefaultMutableTreeNode leafnode=new DefaultMutableTreeNode("baicai");
		DefaultMutableTreeNode lnode=new DefaultMutableTreeNode("xiaobaicai");
		node1.add(leafnode);
		leafnode.add(lnode);
		JTree tree=new JTree(root);
		JScrollPane sp=new JScrollPane();
		sp.setViewportView(tree);
		cp.add(sp);
		f.pack();
		
	}
	public static void main(String[] args) {
		new Jdefaultmutabletreenode();

	}

}
